home *** CD-ROM | disk | FTP | other *** search
/ Revista CD Expert 37 / CD Expert nº 37.iso / LastCall / lastcall.exe / stuff / lastcall.dxr / 00232_Test VO's in database.ls < prev    next >
Encoding:
Text File  |  2000-03-27  |  1.8 KB  |  60 lines

  1. property pCharCode, pSpr, pEvents
  2.  
  3. on beginSprite me
  4.   global gTestFlashIndex, gImplementedCharacters, gCharacterActions, gRecipes
  5.   if voidp(gRecipes) then
  6.     initRecipes()
  7.   end if
  8.   if voidp(gTestFlashIndex) then
  9.     gTestFlashIndex = 1
  10.   end if
  11.   if gTestFlashIndex > count(gImplementedCharacters) then
  12.     put "Test complete"
  13.     halt()
  14.   else
  15.     pCharCode = getPropAt(gImplementedCharacters, gTestFlashIndex)
  16.   end if
  17.   put "Testing VO elements in database for" && pCharCode
  18.   pEvents = gCharacterActions[pCharCode]
  19. end
  20.  
  21. on exitFrame me
  22.   repeat with thisEntry in pEvents
  23.     repeat with X = 1 to count(thisEntry)
  24.       thisEvent = thisEntry[1]
  25.       repeat with Y = 1 to count(thisEvent)
  26.         eventType = getPropAt(thisEvent, Y)
  27.         if eventType = #vo then
  28.           VOname = thisEvent[Y]
  29.           soundFile = VOpath(pCharCode, VOname)
  30.           if FileExists(soundFile) then
  31.           else
  32.             debugAlert("Missing sound file" && soundFile)
  33.           end if
  34.           next repeat
  35.         end if
  36.         if eventType = #anim then
  37.           label = thisEvent[Y]
  38.           thisLabel = findLabel(sprite(1), label)
  39.           if thisLabel then
  40.           else
  41.             debugAlert("Can't find anim label" && label && "for" && pSpr.member.name)
  42.           end if
  43.           next repeat
  44.         end if
  45.         if eventType = #RID then
  46.           recipeID = thisEvent[Y]
  47.           if voidp(getRecipe(recipeID)) then
  48.             debugAlert("Recipe" && recipeID && "could not be found in the recipe database")
  49.           else
  50.           end if
  51.           next repeat
  52.         end if
  53.         debugAlert("Unknown event of type" && eventType && "not verified")
  54.       end repeat
  55.     end repeat
  56.   end repeat
  57.   put "done testing VO elements in database for" && pCharCode
  58.   go("test done")
  59. end
  60.